<!DOCTYPE html>
<html>
<head>
	<title>首页</title>
	<meta charset="utf-8">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1,maximum-scale=1">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" href="./layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="css/index.css">
	<script src="./js/jquery-1.12.4.min.js"></script>
</head>
<body>
<?php include_once('config/header.php'); ?>

<div class="content">
	<div class="con-left">
		<div class="hot">
			<div class="layui-carousel banner" id="test1" style="margin-bottom: 20px;">
				<div class="banner" id="banner" carousel-item>

				</div>
			</div>
			<div class="hot-news" id="hot-news">
			</div>
		</div>
		<div class="news">
			<div class="news-nav">
				<ul id="tow_nav">
				</ul>
			</div>
			<div class="new-label">
				<ul>
					<li class="all">全部</li>
					<li>中国</li>
					<li>美国</li>
					<li>日本</li>
					<li>韩国</li>
					<li>英国</li>
					<li>欧盟</li>
					<li>欧盟</li>
					<li>意大利</li>
				</ul>
				<a href=""><img src=""></a>
			</div>
			<div class="news-list" id="news_list">
				
			</div>
			<div class="more">查看更多</div>
		</div>
	</div>
	<div class="con-right">
		<div class="newest">
			<div class="box-1">
				<div class="title">最新 &nbsp;</div>
				<div class="newest-content">
					<img src="./images/201811201210304284.png" class="img">
					<div class="tit1">美国大都会银行推出可交易加密货币的Visa卡</div>
					<div class="author">
						<div class="left">
							<a class="member_name">橙皮书</a>
							<img src="./images/dian.png" class="dian">
							<span>1小时前</span>
						</div>
						<div class="right">
							<a href=""><img src="./images/zan.png"></a>
							<p>100</p>
							<a href=""><img src="./images/eye.png"></a>
							<p>9999</p>
							<a href=""><img src="./images/comment1.png"></a>
							<p>20</p>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php include_once('config/ranking.php'); ?>
		<div class="special">
			<div class="box-1">
				<div class="title">
					<div class="img">
						<img src="./images/yuanzhu.png">
					</div>
					<div class="tit1">专栏作者</div>
					<a href="">更多 <img src="./images/youjt.png"></a>
				</div>
				<div id="author">
					<div class="writer">
						<div class="writer-head">
							<img src="./images/201811191520442367-380x228.png">
							<div class="memberinfo">
								<p>郝大力</p>
								<span>文章数 <b>6</b> 浏览量 <b>6</b></span>
							</div>
							<a href="">关注</a>
						</div>
						<div class="writer-essay">
							<ul>
								<li><img src="./images/dian.png">当你说只能合约，你说到底是什么？</li>
								<li><img src="./images/dian.png">手把手教你学会看区块链</li>
								<li><img src="./images/dian.png">手把手教你学会看区块链学会看区块链的实...</li>
							</ul>
						</div>
					</div>
					<div class="writer">
						<div class="writer-head">
							<img src="./images/201811191520442367-380x228.png">
							<div class="memberinfo">
								<p>郝大力</p>
								<span>文章数 <b>6</b> 浏览量 <b>6</b></span>
							</div>
							<a href="">关注</a>
						</div>
						<div class="writer-essay">
							<ul>
								<li><img src="./images/dian.png">当你说只能合约，你说到底是什么？</li>
								<li><img src="./images/dian.png">手把手教你学会看区块链</li>
								<li><img src="./images/dian.png">手把手教你学会看区块链学会看区块链的实...</li>
							</ul>
						</div>
					</div>
					<div class="writer">
						<div class="writer-head">
							<img src="./images/201811191520442367-380x228.png">
							<div class="memberinfo">
								<p>郝大力</p>
								<span>文章数 <b>6</b> 浏览量 <b>6</b></span>
							</div>
							<a href="">关注</a>
						</div>
						<div class="writer-essay">
							<ul>
								<li><img src="./images/dian.png">当你说只能合约，你说到底是什么？</li>
								<li><img src="./images/dian.png">手把手教你学会看区块链</li>
								<li><img src="./images/dian.png">手把手教你学会看区块链学会看区块链的实...</li>
							</ul>
						</div>
					</div>
				</div>
				<a href=""><div class="change"><img src="./images/fresh.png"><p>换一批</p></div></a>
			</div>
		</div>
		<?php include_once('config/label-b.php'); ?>
	</div>
</div>
<div class="flash-video">
	<div class="video">
		<div class="title">
			<div class="tit">视频</div>
			<p>每日精选极有料的区块链技术与数字货币科普、访谈、资讯等视频</p>
			<div class="more">更多视频 &nbsp;<img src="./images/youjt1.png"></div>
		</div>
		<div class="video-key">
			<div class="video-v">
				<embed id="video1" src="https://imgcache.qq.com/tencentvideo_v1/playerv3/TPout.swf?max_age=86400&v=20161117&vid=d0646pjst6o&auto=0" allowFullScreen="true" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>
			</div>
			<div class="video-list">
				<div class="this-voide">
					<img src="./images/video1.png">
					<p>区块链行业最有趋向性的聚集地,深度思想引领进入区块链高地</p>
				</div>
				<div class="videolist">
					<div class="video-va">
						<div class="img">
							<img src="">
						</div>
						<div class="v-lcon">
							<p>曾63元入手比特币，6年币圈老人，币信Coo熊越...</p>
							<span>20:45</span>
						</div>
					</div>
					<div class="video-va">
						<div class="img">
							<img src="">
						</div>
						<div class="v-lcon">
							<p>曾63元入手比特币，6年币圈老人，币信Coo熊越...</p>
							<span>20:45</span>
						</div>
					</div>
					<div class="video-va">
						<div class="img">
							<img src="">
						</div>
						<div class="v-lcon">
							<p>曾63元入手比特币，6年币圈老人，币信Coo熊越...</p>
							<span>20:45</span>
						</div>
					</div>
					<div class="video-va">
						<div class="img">
							<img src="">
						</div>
						<div class="v-lcon">
							<p>曾63元入手比特币，6年币圈老人，币信Coo熊越...</p>
							<span>20:45</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<?php include_once('config/footer.php'); ?>
</body>
</html>
<script src="./layui/layui.js"></script>
<script src="./js/function.js"></script>
<script type="text/javascript">
$(function(){
	//首页热门接口
	var index_hot_url = 'http://'+document.domain+"/index/data/index_hot_new";
	$.ajax({
		type: 'POST',
        url: index_hot_url,
        data:{},
        dataType: 'json',
        success: function(result){
        	var html = '';
			result.forEach((item,i)=>{
				html += '<div class="banner-list">';
				html += '<img src="'+result[i]['img']+'" class="img">';
				html += '<div class="title">';
				html += '<a href="article.php?id='+result[i]['id']+'"><p>'+result[i]['title']+'</p></a>';
				html += '<span>'+result[i]['member_name']+'&nbsp;&nbsp;'+timestampToTime(result[i]['addtime'])+'&nbsp;&nbsp;<img src="./images/comment1.png"> '+result[i]['comments']+'</span>';
				html += '</div>';
				html += '</div>';
			})
			$('#banner').html(html);
        },
	});
	var hot_new_url = 'http://'+document.domain+"/index/data/hot_new";
	//首页推荐文章
	$.ajax({
		type: 'POST',
        url: hot_new_url,
        data:{},
        dataType: 'json',
        success: function(result){
        	var html = '';
			result.forEach((item,i)=>{
				html += '<div class="news-list">';
					html += '<img src="'+result[i]['img']+'" class="img">';
					html += '<div class="con">';
					html += '<a href="article.php?id='+result[i]['id']+'"><div class="title">'+result[i]['title']+'</div></a>';
					html += '<p>'+timestampToTime(result[i]['addtime'])+' <span><img src="./images/comment1.png"> '+result[i]['comments']+'</span></p>';
					html += '</div>';
				html += '</div>';
			})
			$('#hot-news').html(html);
        },
	})
	//首页新闻
	var new_url = 'http://'+document.domain+"/index/data/newlist";
	$.ajax({
		type: 'POST',
        url: new_url,
        data:{},
        dataType: 'json',
        success: function(result){
        	var html = '';
			result.forEach((item,i)=>{
				html += '<div class="list">';
					html += '<a href="article.php?id='+result[i]['id']+'"><img src="'+result[i]['img']+'" class="img"></a>';
					html += '<div class="con">';
						html += '<a href="article.php?id='+result[i]['id']+'"><div class="title">'+result[i]['title']+'</div></a>';
						html += '<p>'+result[i]['abstract']+'</p>';
						html += '<div class="author">';
							html += '<div class="left">';
								html += '<img src="./images/201811200020216214-380x228.png" class="head_pic">';
								html += '<a href="author.php?id='+result[i]['user_id']+'" class="member_name">'+result[i]['member_name']+'</a>';
								html += '<img src="./images/dian.png" class="dian">';
								html += '<span>'+timestampToTime(result[i]['addtime'])+'</span>';
								html += '<img src="./images/dian.png" class="dian">';
								result[i]['label_v'].forEach((item,j)=>{
									html += '<a class="label" href="label.php?id='+result[i]['label_v'][j]['id']+'">'+result[i]['label_v'][j]['name']+'</a>';
								});
							html += '</div>';
							html += '<div class="right">';
								html += '<a href=""><img src="./images/zan.png"></a>';
								html += '<p>100</p>';
								html += '<img src="./images/eye.png">';
								html += '<p>9999</p>';
								html += '<img src="./images/comment1.png">';
								html += '<p>20</p>';
							html += '</div>';
						html += '</div>';
					html += '</div>';
				html += '</div>';
			})
			$('#news_list').html(html);
        },
	})
	//首页导航
	var news_nav_url = 'http://'+document.domain+"/index/data/NavList";
	$.ajax({
		type: 'POST',
        url: news_nav_url,
        data:{cat_id:1},
        dataType: 'json',
        success: function(result){
        	var html = '';
			result.forEach((item,i)=>{
				if (i==0) {
					html += '<li class="bot-tis" onclick="news_nav(this,'+result[i]['id']+')">'+result[i]['name']+'</li>';
				}else{
					html += '<li data-id="'+result[i]['id']+'" onclick="news_nav(this,'+result[i]['id']+')">'+result[i]['name']+'</li>';
				}
			})
			$('#tow_nav').html(html);
        },
	})
	//作者列表
	var author_url = 'http://'+document.domain+"/index/data/hot_gather";
	$.ajax({
		type: 'POST',
        url: author_url,
        data:{},
        dataType: 'json',
        success: function(result){
        	var html = '';
			result.forEach((item,i)=>{
				html += '<div class="writer">';
					html += '<div class="writer-head">';
						html += '<a href="author.php?id='+result[i]['user_id']+'"><img src="./images/201811191520442367-380x228.png"></a>';
						html += '<div class="memberinfo">';
							html += '<p>'+result[i]['member_name']+'</p>';
							html += '<span>文章数 <b>'+result[i]['consult']+'</b> 浏览量 <b>'+result[i]['browse']+'</b></span>';
						html += '</div>';
						html += '<a href="" id="attention">关注</a>';
					html += '</div>';
					html += '<div class="writer-essay">';
						html += '<ul>';
							result[i]['consult_list'].forEach((item,j)=>{
								html += '<a href="article.php?id='+result[i]['consult_list'][j]['id']+'"><li><img src="./images/dian.png">'+result[i]['consult_list'][j]['title']+'</li></a>';
							})
						html += '</ul>';
					html += '</div>';
				html += '</div>';
			})
			$('#author').html(html);
        },
	})
	layui.use('carousel', function(){
	  var carousel = layui.carousel;
	  //建造实例
	  carousel.render({
	    elem: '#test1'
	    ,width: '100%' //设置容器宽度
	    ,height: '400px' //设置容器高度
	    ,arrow: 'always' //始终显示箭头
	    ,interval:5000
	    //,anim: 'updown' //切换动画方式
	  });
	});
})
</script>